﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace UFIDA.U9.Cust.XH.PlugBE.Model
{
    /// <summary>
    /// 销售报价
    /// </summary>
    public class QuotationModel
    {
        public QuotationModel(UFIDA.U9.SM.Quotation.Quotation m)
        {
            this.DocumentType_Name = m.DocumentType?.Name;
            this.DocNo = m.DocNo;
            this.QuotaDate = m.QuotaDate;
            this.CreatedBy = m.CreatedBy;
            this.CreatedOn = m.CreatedOn;
            this.Saleser_Name = m.Seller?.Name;
            this.Status = UFIDA.U9.PM.PO.PODOCStatusEnum.EnumRes.GetResource(m.Status.Name);
            this.AC_Name = m.AC.Name;
            this.AccountOrg_Name = m.AccountOrg.Name;
            this.InvoiceOrg_Name = m.InvoiceOrg.Name;
            this.Memo = m.Memo;
            this.Customer_Name = m.OrderBy.Customer.Name;
            this.ARConfirmTerm_Name = m.OrderBy.Customer.ARConfirmTerm.Name;
            this.Customer_FullName = m.DescFlexField.PrivateDescSeg2;
        }
        public string DocumentType_Name { get; set; }
        public string DocNo { get; set; }
        public DateTime QuotaDate { get; set; }
        public string CreatedBy { get; set; }
        public DateTime CreatedOn { get; set; }
        public string Saleser_Name { get; set; }
        public string Status { get; set; }
        public string AC_Name { get; set; }
        public string AccountOrg_Name { get; set; }
        public string InvoiceOrg_Name { get; set; }
        public string Memo { get; set; }
        public string Customer_Name { get; set; }
        /// <summary>
        /// 终端客户
        /// </summary>
        public string Customer_FullName { get; set; }
        /// <summary>
        /// 立账条件
        /// </summary>
        public string ARConfirmTerm_Name { get; set; }
    }


    public class QuotationLineModel
    {
        public QuotationLineModel(UFIDA.U9.SM.Quotation.QuotationLine m)
        {
            this.ItemCode = m.ItemInfo.ItemCode;
            this.ItemName = m.ItemInfo.ItemName;
            this.ItemSPECS = m.ItemInfo.ItemID.SPECS;
            this.PurchaseUOM_Name = m.ItemInfo.ItemID.PurchaseUOM.Name;
            this.OrderQtyPU = m.OrderQtyPU;
            this.PUUOM_Name = m.PU.Name;
            this.OrderPriceTC = m.OrderPriceTC;
            this.DiscountRate = m.DiscountRate;
            this.FinallyPriceFC = m.FinallyPriceFC;
            this.NetMontyAC = m.NetMontyAC;
            this.TaxMoneyAC = m.TaxMoneyAC;
            this.TaxRate = m.TaxRate;
            this.TotalMoneyFC = m.TotalMoneyFC;
            this.RequireDate = m.RequireDate;
            this.LadderNum = "";//自定义字段
            
        }
        public string ItemCode { get; set; }
        public string ItemName { get; set; }
        public string ItemSPECS { get; set; }
        public string PurchaseUOM_Name { get; set; }
        public decimal OrderQtyPU { get; set; }
        public string PUUOM_Name { get; set; }
        public decimal OrderPriceTC { get; set; }
        public decimal DiscountRate { get; set; }
        public decimal FinallyPriceFC { get; set; }
        public decimal NetMontyAC { get; set; }
        public decimal TaxMoneyAC { get; set; }
        public decimal TaxRate { get; set; }
        public decimal TotalMoneyFC { get; set; }
        public DateTime RequireDate { get; set; }     
        public String LadderNum { get; set; }     
    }
}
